import requests
import json
def request_process(url,request_method,request_content):
    print("---------开始调用接口--------")
    if request_method=='get':
        try:
            if isinstance(request_content,dict):
                r=requests.get(url,params=json.dumps(request_content))
            else:
                r=requests.get(url+str(request_content))
        except Exception as e:
            r=None
    elif request_method=='post':
        try:
            if isinstance(request_content,dict):
                r=requests.post(url,data=json.dumps(request_content))
            else:
                raise  ValueError
        except ValueError as e:
            r=None
        except Exception as e:
            r=None
    elif request_method=="put":
        try:
            if isinstance(request_content,dict):
                r=requests.put(url,data=json.dumps(request_content))
            else:
                raise  ValueError
        except ValueError as e:
            r=None
        except Exception as  e:
            r=None
        return  r
